package messageType

type MessageType int

const (
	Notice   MessageType = 10 //通知类消息
	Marking  MessageType = 20 //市场运营类消息
	AuthCode MessageType = 30 //验证码类消息
)

var MessageTypeMap = map[int]string{
	10: "Notice",
	20: "Marking",
	30: "AuthCode",
}

func (e MessageType) String() string {
	switch e {
	case Notice:
		return "Notice"
	case Marking:
		return "Marking"
	case AuthCode:
		return "AuthCode"
	}
	return "None_MessageType"
}

// Values 获取枚举数组
func Values() []MessageType {
	return []MessageType{
		Notice,
		Marking,
		AuthCode,
	}
}

// ExitOf 判断某个值是否存在于枚举中
func ExitOf(e MessageType) bool {
	for _, v := range Values() {
		if e == v {
			return true
		}
	}
	return false
}
